var SnapshotModalDemo = angular.module('FusionStorUI.snapshot', []);
SnapshotModalDemo.controller('SnapshotModalCtrl', ['$scope','$modal', function($scope, $modal) {
    var modalInstance;
    $scope.open = function(url) {  
        $scope.item = {};
        modalInstance = $modal.open({  
            templateUrl : url,
            controller : SnapshotModalInstanceCtrl, 
            backdrop:'static',  
                keyboard: false,
            resolve : { 
                item : function() {  
                    return $scope.item;  
                }  
            }  
        });  
    };  

    $scope.close = function() {
        modalInstance.dismiss('cancel');  
    }
}]); 
var SnapshotModalInstanceCtrl = function($scope, $modalInstance, item) {  
    $scope.item = item;  
    $scope.selected = {  
        item : $scope.item 
    };  
    $scope.ok = function() {  
        submit_snapshot_create();
    };  
    $scope.clone_ok = function(){  
        submit_snapshot_clone();
    }; 
    $scope.snapshot_policy_create = function() {
        submit_snapshot_policy();
    };
    $scope.cancel = function() {  
        $modalInstance.dismiss('cancel');  
    };  
};  
